//
//  User.swift
//  BarCode
//
//  Created by xxcao on 2017/4/5.
//  Copyright © 2017年 MobileArtisan. All rights reserved.
//

import UIKit
import Foundation

var gUser = User()

var userList:[User] = []

@objc class User: NSObject {
    var user_name:String?
    var full_name:String?
    var user_id:String?
    
    func transeferDic2User(dic:Dictionary<String, Any>) {
        user_name = dic["username"] as? String
        full_name = dic["fullname"] as? String
        user_id = dic["objectId"] as? String
    }
}

class Bridge2OC: NSObject {
    
    class func setUserList(datas:Array<Any>) {
        userList.removeAll(keepingCapacity: true)
        for item in datas {
            userList.append(item as! User)
        }
    }
    
    class func getUserList()-> Array<Any> {
       return userList
    }
    
    class func removeUserList() {
        userList.removeAll(keepingCapacity: true)
    }
    
    class func appendUserList(user:User) {
        userList.append(user)
    }
}

